import json

from config import BASE_DIR


def read_json_data(filename):
    with open(BASE_DIR + filename, 'r', encoding="utf-8") as f:
        json_list = json.load(f)
        list_data = []
        for dict in json_list:
            list_data.append(tuple(dict.values()))
        return list_data


def read_login_data(filename):
    with open(BASE_DIR + filename, 'r', encoding="utf-8") as f:
        json_list = json.load(f)
        list_data = []
        for dict in json_list:
            dict.pop("id")
            dict.pop("desc")
            list_data.append(tuple(dict.values()))
        return list_data


if __name__ == '__main__':
    # 不要忘记写文件的后缀名.json
    print(read_json_data("/data/zy_login_data_01.json"))
    print('-'*30)
    print(read_json_data("/data/login_data_json.json"))
    print('-' * 30)
    print(read_login_data("/data/zy_login_data.json"))
